<template>
  <aside class="btn-box">
    <el-row>
      <el-col :span="2">
        <el-button type="primary" size="mini" icon="el-icon-circle-plus-outline" @click="addFun">新增授权</el-button>
        <add-dialog ref="addNew" :levels="agentLevel" @selectLevels="selectLevels" />
      </el-col>
    </el-row>
  </aside>
</template>

<script>
import addDialog from './impower-dialog'
export default {
  components: {
    addDialog
  },
  props: {
    agentLevel: {
      type: Array,
      default() {
        return []
      }
    }
  },
  methods: {
    addFun() {
      this.$refs['addNew'].dialogFormVisible = true
    },
    selectLevels(val) {
      console.log(val)
      this.$emit('selectLevels', val)
    }
  }

}
</script>

<style lang="sass" scoped>

</style>
